home *** CD-ROM | disk | FTP | other *** search
/ Gekkan Dennou Club 145 / Gekkan Dennou Club - 2000.6 Vol. 145 (Japan).7z / Gekkan Dennou Club - 2000.6 Vol. 145 (Japan) (Track 1).bin / tools / sharp / sxwork3.lzh / 福袋 / 注釈付ヘッダ / CONTROL.H < prev    next >
Text File  |  1994-02-20  |  5KB  |  161 lines

  1. /*
  2.  * control.h X68k SX_SYSTEM ver 2.01 Copyright 1994 SHARP/First Class Technology
  3.  */
  4. #ifndef __CONTROL_H
  5. #define __CONTROL_H
  6.  
  7. #ifndef __SXDEF2_H
  8. #include <sxdef2.h>
  9. #endif
  10.  
  11. #ifdef FORWORD
  12. #define __PROTO_TYPE
  13. #endif
  14. #ifdef __STDC__
  15. #define __PROTO_TYPE
  16. #endif
  17.  
  18. typedef enum CDEFRscID    CDEFRscID;    /* CDEFリソースのID        */
  19. typedef enum CDEFCommand CDEFCommand;    /* CDEFコマンド            */
  20. typedef enum CPartCode    CPartCode;    /* コントロールパートコード    */
  21.  
  22. typedef struct CNTL    CNTL;        /* コントロールテンプレート    */
  23. /*
  24.  *    コントロールマン (Control Man)
  25.  */
  26. #define C_DEFAULT    ((void *) -1)    /* デフォルト            */
  27.  
  28. enum CDEFRscID {            /* CDEFリソースのID        */
  29.     CI_CHRBTN,            /* 文字ボタン            */
  30.     CI_RADBTN,            /* ラジオボタン            */
  31.     CI_CHKBOX,            /* チェックボックス        */
  32.     CI_SLDVOL    = 0x13,        /* スライドボリューム        */
  33.     CI_ADJBTN,            /* 数値調整ボタン        */
  34.     CI_SCLBRWH    = 0x40,        /* ウィンドウ用横スクロールバー    */
  35.     CI_SCLBRWV,            /* ウィンドウ用縦スクロールバー    */
  36.     CI_SCRLBRH,            /* 汎用横スクロールバー        */
  37.     CI_SCRLBRV            /* 汎用縦スクロールバー        */
  38. };
  39.  
  40. enum CDEFCommand {            /* CDEFコマンド            */
  41.     CMD_CDRAW,            /* コントロールの描画        */
  42.     CMD_CWHERE,            /* 指定した座標のパートの調査    */
  43.     CMD_CCALC,            /* コントロールリージョンの計算    */
  44.     CMD_CINIT,            /* コントロールレコードの初期化    */
  45.     CMD_CDISP,            /* コントロールの廃棄        */
  46.     CMD_CPOS,            /* サムのトラックに伴う値の計算    */
  47.     CMD_CTHUMB,            /* サムのトラック中の枠の計算    */
  48.     CMD_CDRAG,            /* コントロールのドラッグ処理    */
  49.     CMD_CTRACK            /* サムのトラック処理        */
  50. };
  51.  
  52. enum CPartCode {            /* コントロールパートコード    */
  53.     C_INBTTN    =  10,        /* 文字ボタン            */
  54.     C_INCHECK,            /* チェックボックス、ラジオボタン */
  55.     C_INDEC        =  20,        /* 数値調整ボタンの減少ボタン    */
  56.     C_ININC,            /* 数値調整ボタンの増加ボタン    */
  57.     C_INUP        =  20,        /* スクロールアップボタン    */
  58.     C_INDOWN,            /* スクロールダウンボタン    */
  59.     C_INPGUP,            /* ページスクロールアップボタン    */
  60.     C_INPGDOWN,            /* ページスクロールダウンボタン    */
  61.     C_INTITLE,            /* 数値調整ボタンのタイトル    */
  62.     C_INTHUMB    = 129,        /* サム、スクロールボックス    */
  63.     C_ACTIVE    =   0,        /* アクティブ            */
  64.     C_INACTIVE    = 255        /* インアクティブ        */
  65. };
  66.  
  67. struct Control {            /* コントロールレコード        */
  68.     Control **next;            /* 次のコントロールハンドル    */
  69.     Window *window;            /* 自分が描かれるウィンドウポインタ */
  70.     Rect rect;            /* 自分の大きさを示すレクタングル */
  71.     char visible;            /* 可視フラグ            */
  72.     char hilite;            /* 強調表示/アクティブ状態    */
  73.     short value;            /* 現在値            */
  74.     short min;            /* 最小値            */
  75.     short max;            /* 最大値            */
  76.     long (**def)();            /* コントロール定義関数へのハンドル */
  77.     unsigned short option;        /* コントロールオプション    */
  78.     long defData;            /* コントロール定義関数のデータ    */
  79.     long (*proc)();            /* トラック中の処理関数へのポインタ */
  80.     long user;            /* ユーザー用ワークエリア    */
  81.     LASCII title;            /* コントロールタイトル        */
  82. };
  83.  
  84. struct CNTL {                /* コントロールテンプレート    */
  85.     Rect bounds;            /* コントロールのレクタングル    */
  86.     short value;            /* 初期値            */
  87.     short visible;            /* 可視フラグ            */
  88.     short max;            /* 最大値            */
  89.     short min;            /* 最小値            */
  90.     short ID;            /* リソースCDEFのID×16+オプション */
  91.     long user;            /* ユーザーワークの初期値    */
  92.     LASCII title;            /* コントロールタイトル        */
  93. };
  94.  
  95. #ifdef __PROTO_TYPE
  96.  
  97. Control **CMOpen(Window *, Rect *, const _LASCII, BOOLEAN, int, int, int, int, long);
  98. int CMDispose(Control **);
  99. int CMKill(Window *);
  100. int CMHide(Control **);
  101. int CMShow(Control **);
  102. int CMDraw(Window *);
  103. int CMDrawOne(Control **);
  104. int CMValueSet(Control **, int);
  105. int CMValueGet(Control **);
  106. int CMMinSet(Control **, int);
  107. int CMMinGet(Control **);
  108. int CMMaxSet(Control **, int);
  109. int CMMaxGet(Control **);
  110. int CMMove(Control **, LPoint);
  111. int CMSize(Control **, LPoint);
  112. int CMShine(Control **, int);
  113. int CMFind(LPoint, Window *, Control ***);
  114. int CMCheck(Control **, LPoint, void (*)());
  115. Control **CMRefer(int, Window *);
  116. int CMTitleGet(Control **, _LASCII);
  117. int CMDraws(Window *, Region **);
  118. int CMTitleSet(Control **, const _LASCII);
  119. unsigned short CMOptionGet(Control **);
  120. void CMOptionSet(Control **, unsigned short);
  121. long CMUserGet(Control **);
  122. void CMUserSet(Control **, long);
  123. long CMDefDataGet(Control **);
  124. void CMDefDataSet(Control **, long);
  125.  
  126. #undef __PROTO_TYPE
  127. #else
  128.  
  129. Control **CMOpen();
  130. int CMDispose();
  131. int CMKill();
  132. int CMHide();
  133. int CMShow();
  134. int CMDraw();
  135. int CMDrawOne();
  136. int CMValueSet();
  137. int CMValueGet();
  138. int CMMinSet();
  139. int CMMinGet();
  140. int CMMaxSet();
  141. int CMMaxGet();
  142. int CMMove();
  143. int CMSize();
  144. int CMShine();
  145. int CMFind();
  146. int CMCheck();
  147. Control **CMRefer();
  148. int CMTitleGet();
  149. int CMDraws();
  150. int CMTitleSet();
  151. unsigned short CMOptionGet();
  152. void CMOptionSet();
  153. long CMUserGet();
  154. void CMUserSet();
  155. long CMDefDataGet();
  156. void CMDefDataSet();
  157.  
  158. #endif __PROTO_TYPE
  159.  
  160. #endif __CONTROL_H
  161.